# Copyright 2023, Gerwin Klein <lsf@jflex.de>
# SPDX-License-Identifier: BSD-3-Clause

load("//testsuite:testsuite.bzl", "jflex_testsuite")
load("@jflex_rules//jflex:jflex.bzl", "jflex")
load("//scripts:check_deps.bzl", "check_deps")

check_deps(
    name = "deps_to_bootstrap_jflex_test",
    prohibited = "@jflex_rules//jflex:jflex_bin",
)

[jflex_testsuite(
    name = "LimitTest%d" % i,
    srcs = [
        "LimitTest%d.java" % i,
    ],
    data = [
        "sys-out%d.txt" % i,
        "limit%d.flex" % i,
    ],
    deps = [
        "//jflex/src/main/java/jflex/exceptions",
    ],
) for i in range(1, 6)]

jflex(
    name = "gen_limit_scanner",
    srcs = ["limit_success.flex"],
    jflex_bin = "//jflex:jflex_bin",
    outputs = ["Limit_Success.java"],
)

java_library(
    name = "limit_scanner",
    srcs = [
        ":gen_limit_scanner",
    ],
)

java_test(
    name = "LimitTest0",
    size = "small",
    srcs = [
        "LimitTest0.java",
    ],
    data = [
    ],
    deps = [
        ":limit_scanner",
        "//java/de/jflex/util/scanner:scanner_factory",
        "//third_party/com/google/truth",
    ],
)
